to select ↑↓ to navigate
Frappe Framework

Frappe Framework

Open in ChatGPT
Ask ChatGPT about this page
Open in Claude
Ask Claude about this page

Customize Form - States Table

The states table in the Customize Form Doctype allows users to define custom states (or statuses) for a Doctype, often used in workflows. Each row in the states table represents a specific state and includes fields that determine its behavior and display. Here’s an explanation of each field and its usage:


1. title

  • Description: The name of the state or status.
  • Use:
    • Represents the current state of a document (e.g., "Draft," "Pending Approval," "Approved").
    • Displayed prominently in the document header or workflow status field.

2. color

  • Description: Defines the color associated with the state.
  • Use:
    • Helps visually differentiate between states.
    • Commonly used colors include green for "Approved," red for "Rejected," and yellow for "Pending."
    • Accepts color codes or predefined labels like "Red," "Green," etc.

3. idx

  • Description: Specifies the order of the states in the list.
  • Use:
    • Controls the sequence in which states are displayed.
    • Ensure logical progression (e.g., "Draft" → "Submitted" → "Approved").

4. group

  • Description: Categorizes the state under a specific group.
  • Use:
    • Organize states for easier management.
    • For example, grouping states under "Approval Flow" or "Completion Stages."

5. hidden

  • Description: Determines whether the state is hidden from the user interface.
  • Use:
    • Hide states that are only relevant for backend processes or specific users.
    • For example, a temporary state used for automated processing.

Examples of Usage:

  1. Basic Workflow States:
    • Row 1:
      • title: Draft
      • color: Grey
      • Use: Represents a document that is being edited but not yet finalized.
    • Row 2:
      • title: Submitted
      • color: Blue
      • Use: Indicates the document has been finalized and submitted for review.
    • Row 3:
      • title: Approved
      • color: Green
      • Use: Marks the document as approved.

  1. Advanced Workflow States with Hidden States:
    • Row 1:
      • title: Draft
      • color: Grey
    • Row 2:
      • title: Under Review
      • color: Yellow
    • Row 3:
      • title: Sent Back
      • color: Orange
    • Row 4:
      • title: Automated Processing
      • color: Red
      • hidden: Checked
      • Use: A hidden state used for system-generated actions, not visible to users.

  1. Grouped States for Better Organization:
    • Row 1:
      • title: In Progress
      • color: Blue
      • group: Task Flow
    • Row 2:
      • title: Completed
      • color: Green
      • group: Task Flow
    • Row 3:
      • title: Canceled
      • color: Red
      • group: Task Flow

  1. Custom States for a Leave Application:
    • Row 1:
      • title: Draft
      • color: Grey
      • Use: Default state for newly created leave applications.
    • Row 2:
      • title: Pending Approval
      • color: Yellow
      • Use: Indicates that the leave application is waiting for manager approval.
    • Row 3:
      • title: Approved
      • color: Green
      • Use: Marks the leave application as approved.
    • Row 4:
      • title: Rejected
      • color: Red
      • Use: Indicates the leave application has been rejected.

How States Are Used in Workflows:

  • Display in Document Header:
    • The state is often displayed prominently at the top of the document.
  • Trigger Actions:
    • States can trigger specific actions or transitions in workflows (e.g., send notifications on state change).
  • Filter and Reports:
    • Documents can be filtered by states (e.g., show all "Pending Approval" documents).
  • Visual Indicators:
    • Colors and titles make it easy to understand the current state of a document at a glance.

By defining custom states in the states table, you can enhance the usability of workflows and improve document management within your ERP system.

Last updated 4 days ago
Was this helpful?
Thanks!